<?php
class PhpAuthManager extends CPhpAuthManager{

	public function init()
	{
		if($this->authFile===null){
			$this->authFile=Yii::getPathOfAlias('application.config.auth').'.php';
		}

        parent::init();

		// For guests we have 'Guest' role name by default. Assigning role name only for different from 'Guest'
		if(!Yii::app()->user->isGuest){
			// Assign user role name from DB with his ID
			// which returned by UserIdentity.getId().
			$this->assign(Yii::app()->user->role, Yii::app()->user->id);
		}
	}
}
?>